<?php


function XSLTGetNumWithCase ($cnt, $case1, $case2, $case3) {
	return getNumWithCase ($cnt, array ($case1, $case2, $case3));
}

function XSLTDotsString ($string, $maxChars = 30) {
	$string = (string) $string;
	$maxChars = (int) $maxChars;
	
	if (mb_strlen ($string) > $maxChars) {
		$string = substr ($string, 0, $maxChars) . '...';
	}
	
	return $string;
}

function XSLTParseMicroTags($string, $uri) {
	return preg_replace("/\#([a-zа-я0-9-_]*)/iu", '<a href="' . $uri . '\\1">#\\1</a>', $string);
}